//
//  LRUserInfo.m
//  本地生活圈
//
//  Created by admin on 15/8/14.
//  Copyright (c) 2015年 懒人. All rights reserved.
//

#import "LRUserInfo.h"

@implementation LRUserInfo

+ (LRUserInfo *)shareInstance
{
    static LRUserInfo *user = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        user = [[LRUserInfo alloc]init];
    });
    return user;
}

+ (void)pareseUserInfo:(NSDictionary *)dic
{
    if (dic == nil) return;
    [self shareInstance].user_id = dic[@"user_id"];
    [self shareInstance].user_name = dic[@"user_name"];
    [self shareInstance].middle_avatar = dic[@"middle_avatar"];
    [self shareInstance].gender = dic[@"gender"];
    [self shareInstance].mobile = dic[@"mobile"];
    [self shareInstance].nick_name = dic[@"nick_name"];
    [self shareInstance].small_avatar = dic[@"small_avatar"];
    [self shareInstance].remember_me = dic[@"remember_me"];
    
    [self shareInstance].isLogin = YES;
}

- (id)initWithDic:(NSDictionary *)dic{
    
    if (self = [super init]) {
        self.user_name = dic[@"user_name"];
    }
    
    return self;
    
}
@end
